#include "Ray.h"
#include "Vector3.h"
#include <iostream>

Ray::Ray(Vector3 new_direction, Vector3 new_start, int newLife)
{
    direction = Vector3::normalize(new_direction);
    start = new_start;
    life = newLife;
}

Ray::Ray()
{
    direction = Vector3(0.0, 0.0, 0.0);
    //direction = new_direction;
    start = Vector3(0.0, 0.0, 0.0);
}

void Ray::SetRay(Vector3 new_direction, Vector3 new_start, int newLife)
{
    direction = Vector3::normalize(new_direction);
    life = newLife;
    start = new_start;
}

std::ostream& operator<< (std::ostream& out, const Ray inRay) {
    out << "Start: " << inRay.start << " , Direction: " << inRay.direction;
    return out;
}

void Ray::Advance()
{
    start = start + 0.0001 * direction;
}
